package com.juyu.miliao.common.constant;

import lombok.Getter;

import java.text.MessageFormat;

/**
 * @author xuanqicheng
 * @create 2019-28-13:57
 */
@Getter
public enum ReceiveGiftSortRedisKey {
    /**
     * 收礼物用户已经处理过的礼物信息id
     */
    EXIST_SEND_ID_BY_INCOME_USER_ID_KEY("EXIST_SEND_ID_BY_INCOME_USER_ID_KEY:{0}",
            "收礼物用户已经处理过的spendId"),
    /**
     * 送给此用户礼物的排行榜，
     * zset结构，
     * key ：ZSET_RECEIVE_GIFT_SORT_BY_INCOME_USER_ID:{收礼物人的id}
     * value: 送礼物的用户id
     * score: 送出礼物总金币
     */
    ZSET_RECEIVE_GIFT_SORT_BY_INCOME_USER_ID_KEY("ZSET_RECEIVE_GIFT_SORT_BY_INCOME_USER_ID:{0}",
            "送给此用户礼物的排行榜"),

    /**
     * 送出礼物集合
     * zset结构
     * key: ZSET_SEND_GIFT_BY_SEND_OUT_USER_AND_INCOME_USER:{送礼物用户id}:{收礼物用户的id}
     * value: 礼物id
     * score: 礼物个数
     */
    ZSET_SEND_GIFT_BY_SEND_OUT_USER_AND_INCOME_USER_KEY("ZSET_SEND_GIFT_BY_SEND_OUT_USER_AND_INCOME_USER:{0}:{1}",
            "送出礼物集合");


    private  String value;

    private String message;

    ReceiveGiftSortRedisKey(String value, String message) {
        this.value = value;
        this.message = message;
    }

    public String getValue(Object... params) {
        return MessageFormat.format(value, params);
    }
}
